# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=elisa
pkgver=22.04.3
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by polkit -> kio
arch="all !armhf !s390x !riscv64"
url="https://kde.org/applications/multimedia/org.kde.elisa"
pkgdesc="A simple music player aiming to provide a nice experience for its users"
license="LGPL-3.0-or-later"
depends="
	kirigami2
	vlc
	"
makedepends="
	baloo-dev
	extra-cmake-modules
	kcmutils-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdeclarative-dev
	kdoctools-dev
	kfilemetadata-dev
	ki18n-dev
	kio-dev
	kirigami2-dev
	kpackage-dev
	kxmlgui-dev
	samurai
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtmultimedia-dev
	qt5-qtquickcontrols2-dev
	qt5-qtsvg-dev
	vlc-dev
	"
checkdepends="
	cmd:dbus-run-session
	xvfb-run
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/elisa-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	# mediaplaylistproxymodelTest and elisaqmltests are broken
	CTEST_OUTPUT_ON_FAILURE=TRUE dbus-run-session xvfb-run ctest -E "(mediaplaylistproxymodelTest|elisaqmltests)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ac1ba9b06eb263f409e798001093cb0ca0b56df565a38a69c78f61bd8820bdd0f3aa53510a0ef0efcab56bea001798ef4c028d48f425499942369e5d5b718040  elisa-22.04.3.tar.xz
"
